1. Field of the Invention
This invention relates to a system for filtering a digital signal and, more particularly, to a digital comb filter which can introduce programmable gain within the filtered digital signal.
2. Description of the Related Art
A microprocessor or microcontroller can be called upon to perform numerous applications, one of which is referred to as digital signal processing ("DSP"). DSP applications are diverse in nature and are comprised of basically three hardware elements or software instructions: multiplication, summing, and delay. These elemental operations must be performed many times for each sample of the incoming signal. Accordingly, a DSP operation presumes that the incoming signal is sampled at relatively equal-spaced intervals within a time domain.
Complex DSP operations can be derived from the basic operational elements to perform applications useful in audio processing, such as reverberation, equalization, compression, limiting and noise reduction. Of benefit is that the basic operational elements can achieve functions far more complex than that achieved by analog circuitry. For at least this reason, analog signals are often converted to digital signals so that complex manipulations can be more readily achieved in real-time.
Summing and delay are operations which are more easily performed than multiplication. Multiplication can be used to implement a multiplier gain upon an incoming digital signal. An execution unit which performs an accumulation function, and a summing function coupled with delay, can be more easily implemented than multiplication. It is therefore of benefit that a DSP implementing noise reduction (i.e., digital filtering) utilizes mostly summing and delay structures (or instructions) rather than the more complex multiplier structures. Partially for this reason, comb filters have enjoyed extensive use as a DSP application.
A typical comb filter is one having an integrator separated from a differentiator by a rate change switch. Depending on whether the rate change switch performs decimation or interpolation, the integrator can be placed either before the rate change switch or after the rate change switch. In the latter instance, the comb filter is said to have been implemented as a comb interpolation filter, whereas the former instance results in a comb decimation filter.
FIG. 1 illustrates two types of comb filter, a comb decimation filter 10a and a comb interpolation filter 10b. Filter 10a receives a digital bit stream D.sub.IN from possibly an analog-to-digital converter and places that digital bit stream into an N.sup.th order integrator 12. Sample rate reduction by factor M is achieved by a decimation switch 14 prior to introducing the lower sample rate into an N.sup.th order differentiator 16. Similar to comb decimation filter 10a, comb interpolation filter 10b receives the digital bit stream D.sub.IN. D.sub.IN is, however, received upon an N.sup.th order differentiator 18 and, prior to forwarding the differentiated output to an N.sup.th order integrator 20, an increase in sample rate occurs via interpolation rate change switch 22.
An overview of comb filters in general and the filter transfer function of various stages of a comb filter is set forth in Chu, et al. Multirate Filter Designs Using Comb Filters (IEEE Trans. Circuits and Systems), pp. 405-416 (herein incorporated by reference). It is generally known that the transfer function of an N.sup.th order comb filter can be represented as: ##EQU1## The transfer function of equation 1 is set forth in a frequency domain, where M represents the rate change factor, N equals the number of orders, and z is equivalent to e.sup.-jw in the frequency domain. It is known that j is an imaginary number and w represents a phase 2.sub..pi. f.
FIG. 1 indicates that one order of comb interpolation filter 10b can be realized as a sample and hold switch 24. A new comb interpolation filter 10c will result having one order reduction within both differentiator 18a and interator 20a. Removing one differentiator and one integrator, and placing the combined differentiator and integrator (comb filter) within sample and hold switch 24 helps minimize the overall complexity of the resulting comb interpolation filter 10c.
Shown in FIG. 2 are structural components which make up the exemplary comb interpolation filter 10c. Specifically, N-1 orders of differentiator 18a are linked to N-1 orders of integrator 20a by the sample and hold switch 24. Orders can often be thought of as distinct operations or "terms." A term is therefore said to embody a single or combination of hardware elements or software instructions. Of benefit to a comb filter is that each term involves one delay element 26 and one add element 28 connected together in feed forward or feed back arrangement. Therefore, a multiplication operation need not be performed to carry out a comb filter operation. If connected in feed forward with a negative add at the sum terminal, the term is said to represent a differentiator. If connected in feed back with a positive add at the sum terminal, the term represents an integrator.
Comb filters, in addition to their less complex nature, achieve superior roll-off characteristics. Higher frequencies naturally receive greater attenuation than lower frequencies. The roll-off benefits are particularly favorable when a comb filter is used as a low pass filter to remove oversampling quantizer noise. Since the lower frequency range is where the comb filter attenuation is lessened, if aliasing or imaging errors occur, they are most likely to occur at the lowest frequency range of the first (or lowest) aliasing or imaging band.
As attenuation requirements become more substantial, the comb filter structure must take on additional orders within its structure. As used above, and defined herein below, an "order" refers to a term needed to employ the filter. FIG. 2 indicates that comb interpolation filter 10c receives a lower frequency digital bit stream having data rate fs and interpolates that signal by a factor M to achieve an increased data rate Mfs. Of course, numerous bit streams beyond bit0 can be filtered, each of which generally utilizes one or more terms of a differentiator separated by one or more terms of an integrator and having a rate change switch interposed between the differentiator and integrator terms.
Partially due to its avoidance of many complex multiplication operations and/or terms, a comb filter is generally constrained to a fixed DC gain arising within the filter. This is better illustrated by reducing the equation 1 transfer function to an equivalent transfer function shown in equation 2, as follows: EQU H(z)=[1+z.sup.-1 +z.sup.-2 +z.sup.-3 +. . . +Z.sup.-(M-1) ].sup.N(Eq. 2)
Given that z=e.sup.-j0, w will equal zero at DC, and e.sup.-jw will reduce to 1, making the equation 2 representation of magnitude appear at DC or steady state, as follows: EQU .vertline.H(z).vertline..sub.DC =[1+1+1+1+ . . . 1].sup.N =M.sup.N(Eq. 3)
The DC gain achieved by a single stage comb filter can therefore be represented as M.sup.N, and therefore dependent solely on the rate change factor M and the number of orders N. A change of the DC gain will require changing M or N with little, if any, flexibility in doing so.
It would be desirable to introduce a comb filter with a programmable DC gain. The programmable gain should be one which can vary depending on the application so that, for example, the filtered output can be increased (or decreased) in magnitude whenever the receiving device is insensitive (or sensitive) to digital voltage changes. That is, the gain is scalable to the receiving device's capabilities. A flexible methodology by which DC gain can be varied to meet any suitable receiver or transmitter would therefore be a benefit in a broad variety of DSP applications with fixed M and N filter values.